//
//  BIZConsultorHeadTabCell.m
//  biz
//
//  Created by zhangfuwei on 2017/4/11.
//  Copyright © 2017年 jieshuibao. All rights reserved.
//

#import "BIZConsultorHeadTabCell.h"
#import "BIZConsultorDetailModel.h"

@interface BIZConsultorHeadTabCell ()

@property (strong, nonatomic) IBOutlet UIImageView *avatarImgV;
@property (strong, nonatomic) IBOutlet UIImageView *starImgV;
@property (strong, nonatomic) IBOutlet UILabel *nameLabel;
@property (strong, nonatomic) IBOutlet UILabel *scoreLabel;
@property (strong, nonatomic) IBOutlet UILabel *postionLabel;


@end

@implementation BIZConsultorHeadTabCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self setupSubViews];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setupSubViews {
    self.avatarImgV.layer.cornerRadius = 35;
    self.avatarImgV.clipsToBounds = YES;
}

-(void)setDetailM:(BIZConsultorDetailModel *)detailM {
    _detailM = detailM;
    _nameLabel.text = detailM.cname;
    _postionLabel.text = detailM.position;
    
    NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"咨询: %.1f分",detailM.score] attributes:@{NSFontAttributeName:CHINESE_SYSTEM(12),NSForegroundColorAttributeName:HEXCOLOR(0xefb907)}];
    [attStr setAttributes:@{NSFontAttributeName:CHINESE_SYSTEM(12),NSForegroundColorAttributeName:HEXCOLOR(0xffffff)} range:NSMakeRange(0, 3)];
    
    _scoreLabel.attributedText = attStr;
    
    [SDWebImageTool imageView:_avatarImgV
                    imageName:detailM.headImg
                  placeHolder:@"default-head"
                 showProgress:NO];
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
